package org.eddycar.jproyeddycar.contrato.vistas;

import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import org.eddycar.jproyeddycar.contrato.dao.DaoClase;
import org.eddycar.jproyeddycar.contrato.dao.DaoMarca;
import org.eddycar.jproyeddycar.contrato.dao.DaoModificacion;
import org.eddycar.jproyeddycar.contrato.dao.DaoTipo;
import org.eddycar.jproyeddycar.contrato.dao.DaoVehiculo;
import org.eddycar.jproyeddycar.contrato.modelo.Clase;
import org.eddycar.jproyeddycar.contrato.modelo.Marca;
import org.eddycar.jproyeddycar.contrato.modelo.Modificacion;
import org.eddycar.jproyeddycar.contrato.modelo.Tipo;
import org.eddycar.jproyeddycar.contrato.modelo.Vehiculo;
import org.jdesktop.observablecollections.ObservableList;

public class VistaBusquedaVehiculo extends javax.swing.JFrame {

    DaoVehiculo dv = new DaoVehiculo();
    File f = new File("");
    DaoClase daoClase = new DaoClase();
    DaoTipo daoTipo = new DaoTipo();
    DaoMarca daoMarca = new DaoMarca();
    DaoModificacion dm = new DaoModificacion();
    Vehiculo v1;
    Modificacion modi;
    Marca marca = new Marca();
    Tipo tipo = new Tipo();
    Clase clase = new Clase();
    boolean edit = false;

    public VistaBusquedaVehiculo() {
        initComponents();
        setLocationRelativeTo(this);
        setLocationRelativeTo(this);
        dateFecha.setYear(new Date().getYear() + 1900);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(VistaBusquedaVehiculo.class);
        entityManager1 = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory(resourceMap.getString("entityManager1.persistenceUnit")).createEntityManager(); // NOI18N
        query1 = java.beans.Beans.isDesignTime() ? null : entityManager1.createQuery(resourceMap.getString("query1.query")); // NOI18N
        list2 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList(query1.getResultList());
        vehiculoQuery = java.beans.Beans.isDesignTime() ? null : entityManager1.createQuery("SELECT v FROM Vehiculo v");
        vehiculoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : vehiculoQuery.getResultList();
        vehiculoQuery1 = java.beans.Beans.isDesignTime() ? null : entityManager1.createQuery("SELECT v FROM Vehiculo v");
        vehiculoList1 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : vehiculoQuery1.getResultList();
        panelImage1 = new org.edisoncor.gui.panel.PanelImage();
        panelRound1 = new org.edisoncor.gui.panel.PanelRound();
        txtPlacaNuevo = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        btnBuscar = new javax.swing.JButton();
        cbBuscar = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        panelRect1 = new org.edisoncor.gui.panel.PanelRect();
        GrupoPaneles = new org.edisoncor.gui.tabbedPane.TabbedPaneVertical();
        panelImage2 = new org.edisoncor.gui.panel.PanelImage();
        PanelNuevoVehiculo = new javax.swing.JPanel();
        lblTelfCel = new javax.swing.JLabel();
        lblMotor1 = new javax.swing.JLabel();
        txtColor = new javax.swing.JTextField();
        lblTelfCel1 = new javax.swing.JLabel();
        lblModelo = new javax.swing.JLabel();
        txtPrecio = new javax.swing.JTextField();
        txtModelo = new javax.swing.JTextField();
        lblMotor2 = new javax.swing.JLabel();
        lblPlacaNuevo2 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        lblPlacaNuevo1 = new javax.swing.JLabel();
        lblChasis1 = new javax.swing.JLabel();
        cbxCiudad = new javax.swing.JComboBox();
        lblPlacaNuevo5 = new javax.swing.JLabel();
        txtAnombre = new javax.swing.JTextField();
        dateFecha = new com.toedter.calendar.JYearChooser();
        lblTelfCel2 = new javax.swing.JLabel();
        lblMotor = new javax.swing.JLabel();
        txtMotor = new javax.swing.JTextField();
        lblChasis = new javax.swing.JLabel();
        txtChasis = new javax.swing.JTextField();
        yearAñoFabricacion = new com.toedter.calendar.JYearChooser();
        txtCilindraje = new javax.swing.JTextField();
        lblPlacaNuevo4 = new javax.swing.JLabel();
        lblPlacaNuevo6 = new javax.swing.JLabel();
        txtPrecioVenta = new javax.swing.JTextField();
        txtMarca = new javax.swing.JTextField();
        txtMatricula1 = new javax.swing.JTextField();
        txtClase = new javax.swing.JTextField();
        txtTipo = new javax.swing.JTextField();
        lblFotoVehiculo = new org.edisoncor.gui.panel.PanelImage();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblModificaciones = new javax.swing.JTable();
        lblExtras = new javax.swing.JLabel();
        lblExtra1 = new javax.swing.JLabel();
        panelImage3 = new org.edisoncor.gui.panel.PanelImage();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        lblVehiculo = new javax.swing.JLabel();
        panelImage4 = new org.edisoncor.gui.panel.PanelImage();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        btnFinalizar2 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setBackground(resourceMap.getColor("Form.background")); // NOI18N
        setName("Form"); // NOI18N

        panelImage1.setToolTipText(resourceMap.getString("panelImage1.toolTipText")); // NOI18N
        panelImage1.setIcon(resourceMap.getIcon("panelImage1.icon")); // NOI18N
        panelImage1.setName("panelImage1"); // NOI18N

        panelRound1.setName("panelRound1"); // NOI18N

        txtPlacaNuevo.setName("txtPlacaNuevo"); // NOI18N

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setForeground(resourceMap.getColor("jLabel2.foreground")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        btnBuscar.setFont(resourceMap.getFont("btnBuscar.font")); // NOI18N
        btnBuscar.setText(resourceMap.getString("btnBuscar.text")); // NOI18N
        btnBuscar.setName("btnBuscar"); // NOI18N
        btnBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarActionPerformed(evt);
            }
        });

        cbBuscar.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "PLACA", "MARCA", "AÑO", "TODOS" }));
        cbBuscar.setName("cbBuscar"); // NOI18N
        cbBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbBuscarActionPerformed(evt);
            }
        });

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N

        javax.swing.GroupLayout panelRound1Layout = new javax.swing.GroupLayout(panelRound1);
        panelRound1.setLayout(panelRound1Layout);
        panelRound1Layout.setHorizontalGroup(
            panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(panelRound1Layout.createSequentialGroup()
                        .addComponent(cbBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(txtPlacaNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 503, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(28, Short.MAX_VALUE))
        );
        panelRound1Layout.setVerticalGroup(
            panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRound1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtPlacaNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelRound1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBuscar)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(20, Short.MAX_VALUE))
        );

        panelRect1.setName("panelRect1"); // NOI18N

        GrupoPaneles.setName("GrupoPaneles"); // NOI18N

        panelImage2.setName("panelImage2"); // NOI18N

        PanelNuevoVehiculo.setBackground(resourceMap.getColor("PanelNuevoVehiculo.background")); // NOI18N
        PanelNuevoVehiculo.setName("PanelNuevoVehiculo"); // NOI18N

        lblTelfCel.setFont(resourceMap.getFont("lblTelfCel.font")); // NOI18N
        lblTelfCel.setForeground(resourceMap.getColor("lblTelfCel.foreground")); // NOI18N
        lblTelfCel.setText(resourceMap.getString("lblTelfCel.text")); // NOI18N
        lblTelfCel.setName("lblTelfCel"); // NOI18N

        lblMotor1.setFont(resourceMap.getFont("lblMotor1.font")); // NOI18N
        lblMotor1.setForeground(resourceMap.getColor("lblMotor1.foreground")); // NOI18N
        lblMotor1.setText(resourceMap.getString("lblMotor1.text")); // NOI18N
        lblMotor1.setName("lblMotor1"); // NOI18N

        txtColor.setName("txtColor"); // NOI18N

        lblTelfCel1.setFont(resourceMap.getFont("lblTelfCel1.font")); // NOI18N
        lblTelfCel1.setForeground(resourceMap.getColor("lblTelfCel1.foreground")); // NOI18N
        lblTelfCel1.setText(resourceMap.getString("lblTelfCel1.text")); // NOI18N
        lblTelfCel1.setName("lblTelfCel1"); // NOI18N

        lblModelo.setFont(resourceMap.getFont("lblModelo.font")); // NOI18N
        lblModelo.setForeground(resourceMap.getColor("lblModelo.foreground")); // NOI18N
        lblModelo.setText(resourceMap.getString("lblModelo.text")); // NOI18N
        lblModelo.setName("lblModelo"); // NOI18N

        txtPrecio.setName("txtPrecio"); // NOI18N

        txtModelo.setName("txtModelo"); // NOI18N

        lblMotor2.setFont(resourceMap.getFont("lblMotor2.font")); // NOI18N
        lblMotor2.setForeground(resourceMap.getColor("lblMotor2.foreground")); // NOI18N
        lblMotor2.setText(resourceMap.getString("lblMotor2.text")); // NOI18N
        lblMotor2.setName("lblMotor2"); // NOI18N

        lblPlacaNuevo2.setFont(resourceMap.getFont("lblPlacaNuevo2.font")); // NOI18N
        lblPlacaNuevo2.setForeground(resourceMap.getColor("lblPlacaNuevo2.foreground")); // NOI18N
        lblPlacaNuevo2.setText(resourceMap.getString("lblPlacaNuevo2.text")); // NOI18N
        lblPlacaNuevo2.setName("lblPlacaNuevo2"); // NOI18N

        jLabel21.setFont(resourceMap.getFont("jLabel21.font")); // NOI18N
        jLabel21.setForeground(resourceMap.getColor("jLabel21.foreground")); // NOI18N
        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel3.setName("jPanel3"); // NOI18N
        jPanel3.setOpaque(false);

        lblPlacaNuevo1.setFont(resourceMap.getFont("lblPlacaNuevo1.font")); // NOI18N
        lblPlacaNuevo1.setForeground(resourceMap.getColor("lblPlacaNuevo1.foreground")); // NOI18N
        lblPlacaNuevo1.setText(resourceMap.getString("lblPlacaNuevo1.text")); // NOI18N
        lblPlacaNuevo1.setName("lblPlacaNuevo1"); // NOI18N

        lblChasis1.setFont(resourceMap.getFont("lblChasis1.font")); // NOI18N
        lblChasis1.setForeground(resourceMap.getColor("lblChasis1.foreground")); // NOI18N
        lblChasis1.setText(resourceMap.getString("lblChasis1.text")); // NOI18N
        lblChasis1.setName("lblChasis1"); // NOI18N

        cbxCiudad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Carchi", "Imbabura", "Pichincha", "Cotopaxi", "Tungurahua", "Bolívar", "Chimborazo", "Cañar", "Azuay", "Loja", "Sto. Domingo de los Tsachilas", "Sucumbíos", "Napo", "Pastaza", "Orellana", "Morona Santiago", "Zamora Chinchipe", "Esmeraldas", "Manabí", "Guayas", "Los Ríos", "El Oro", "Santa Elena" }));
        cbxCiudad.setName("cbxCiudad"); // NOI18N

        lblPlacaNuevo5.setFont(resourceMap.getFont("lblPlacaNuevo5.font")); // NOI18N
        lblPlacaNuevo5.setForeground(resourceMap.getColor("lblPlacaNuevo5.foreground")); // NOI18N
        lblPlacaNuevo5.setText(resourceMap.getString("lblPlacaNuevo5.text")); // NOI18N
        lblPlacaNuevo5.setName("lblPlacaNuevo5"); // NOI18N

        txtAnombre.setName("txtAnombre"); // NOI18N

        dateFecha.setName("dateFecha"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(123, 123, 123)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblChasis1)
                    .addComponent(lblPlacaNuevo5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(cbxCiudad, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(lblPlacaNuevo1)
                        .addGap(18, 18, 18)
                        .addComponent(dateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(txtAnombre, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(63, 63, 63))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblChasis1)
                        .addComponent(cbxCiudad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblPlacaNuevo1))
                    .addComponent(dateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblPlacaNuevo5)
                    .addComponent(txtAnombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        lblTelfCel2.setFont(resourceMap.getFont("lblTelfCel2.font")); // NOI18N
        lblTelfCel2.setForeground(resourceMap.getColor("lblTelfCel2.foreground")); // NOI18N
        lblTelfCel2.setText(resourceMap.getString("lblTelfCel2.text")); // NOI18N
        lblTelfCel2.setName("lblTelfCel2"); // NOI18N

        lblMotor.setFont(resourceMap.getFont("lblMotor.font")); // NOI18N
        lblMotor.setForeground(resourceMap.getColor("lblMotor.foreground")); // NOI18N
        lblMotor.setText(resourceMap.getString("lblMotor.text")); // NOI18N
        lblMotor.setName("lblMotor"); // NOI18N

        txtMotor.setName("txtMotor"); // NOI18N

        lblChasis.setFont(resourceMap.getFont("lblChasis.font")); // NOI18N
        lblChasis.setForeground(resourceMap.getColor("lblChasis.foreground")); // NOI18N
        lblChasis.setText(resourceMap.getString("lblChasis.text")); // NOI18N
        lblChasis.setName("lblChasis"); // NOI18N

        txtChasis.setName("txtChasis"); // NOI18N

        yearAñoFabricacion.setName("yearAñoFabricacion"); // NOI18N

        txtCilindraje.setName("txtCilindraje"); // NOI18N

        lblPlacaNuevo4.setFont(resourceMap.getFont("lblPlacaNuevo4.font")); // NOI18N
        lblPlacaNuevo4.setForeground(resourceMap.getColor("lblPlacaNuevo4.foreground")); // NOI18N
        lblPlacaNuevo4.setText(resourceMap.getString("lblPlacaNuevo4.text")); // NOI18N
        lblPlacaNuevo4.setName("lblPlacaNuevo4"); // NOI18N

        lblPlacaNuevo6.setFont(resourceMap.getFont("lblPlacaNuevo6.font")); // NOI18N
        lblPlacaNuevo6.setForeground(resourceMap.getColor("lblPlacaNuevo6.foreground")); // NOI18N
        lblPlacaNuevo6.setText(resourceMap.getString("lblPlacaNuevo6.text")); // NOI18N
        lblPlacaNuevo6.setName("lblPlacaNuevo6"); // NOI18N

        txtPrecioVenta.setText(resourceMap.getString("txtPrecioVenta.text")); // NOI18N
        txtPrecioVenta.setName("txtPrecioVenta"); // NOI18N

        txtMarca.setText(resourceMap.getString("txtMarca.text")); // NOI18N
        txtMarca.setName("txtMarca"); // NOI18N

        txtMatricula1.setFont(resourceMap.getFont("txtMatricula1.font")); // NOI18N
        txtMatricula1.setName("txtMatricula1"); // NOI18N

        txtClase.setText(resourceMap.getString("txtClase.text")); // NOI18N
        txtClase.setName("txtClase"); // NOI18N

        txtTipo.setText(resourceMap.getString("txtTipo.text")); // NOI18N
        txtTipo.setName("txtTipo"); // NOI18N

        lblFotoVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(resourceMap.getColor("lblFotoVehiculo.border.lineColor"))); // NOI18N
        lblFotoVehiculo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/eddycar/jproyeddycar/negocio/Imagenes/eddycarf2.JPG"))); // NOI18N
        lblFotoVehiculo.setName("lblFotoVehiculo"); // NOI18N

        javax.swing.GroupLayout lblFotoVehiculoLayout = new javax.swing.GroupLayout(lblFotoVehiculo);
        lblFotoVehiculo.setLayout(lblFotoVehiculoLayout);
        lblFotoVehiculoLayout.setHorizontalGroup(
            lblFotoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 285, Short.MAX_VALUE)
        );
        lblFotoVehiculoLayout.setVerticalGroup(
            lblFotoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 203, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout PanelNuevoVehiculoLayout = new javax.swing.GroupLayout(PanelNuevoVehiculo);
        PanelNuevoVehiculo.setLayout(PanelNuevoVehiculoLayout);
        PanelNuevoVehiculoLayout.setHorizontalGroup(
            PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(txtMatricula1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)
                        .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(70, 70, 70)
                                .addComponent(lblTelfCel2))
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(70, 70, 70)
                                .addComponent(lblTelfCel))
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(80, 80, 80)
                                .addComponent(lblTelfCel1))
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(lblMotor2))
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(60, 60, 60)
                                .addComponent(lblModelo))
                            .addComponent(lblMotor)
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(70, 70, 70)
                                .addComponent(lblMotor1)))
                        .addGap(6, 6, 6)
                        .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtClase, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(yearAñoFabricacion, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMotor, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtColor, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLabel21)
                        .addGap(115, 115, 115)
                        .addComponent(lblFotoVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(lblChasis)
                        .addGap(2, 2, 2)
                        .addComponent(txtChasis, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                        .addGap(60, 60, 60)
                        .addComponent(lblPlacaNuevo2)
                        .addGap(9, 9, 9)
                        .addComponent(txtCilindraje, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 580, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addComponent(lblPlacaNuevo6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(lblPlacaNuevo4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtPrecioVenta, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        PanelNuevoVehiculoLayout.setVerticalGroup(
            PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtMatricula1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                        .addGap(40, 40, 40)
                        .addComponent(lblTelfCel2)
                        .addGap(15, 15, 15)
                        .addComponent(lblTelfCel)
                        .addGap(15, 15, 15)
                        .addComponent(lblTelfCel1)
                        .addGap(15, 15, 15)
                        .addComponent(lblMotor2)
                        .addGap(15, 15, 15)
                        .addComponent(lblModelo)
                        .addGap(15, 15, 15)
                        .addComponent(lblMotor)
                        .addGap(15, 15, 15)
                        .addComponent(lblMotor1))
                    .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addComponent(txtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(txtClase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(3, 3, 3)
                        .addComponent(txtTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addComponent(yearAñoFabricacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(3, 3, 3)
                                .addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(3, 3, 3)
                                .addComponent(txtMotor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(3, 3, 3)
                                .addComponent(txtColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                                .addGap(13, 13, 13)
                                .addComponent(jLabel21))))
                    .addGroup(PanelNuevoVehiculoLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addComponent(lblFotoVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(9, 9, 9)
                .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblChasis)
                    .addComponent(txtChasis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3)
                .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblPlacaNuevo2)
                    .addComponent(txtCilindraje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3)
                .addGroup(PanelNuevoVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblPlacaNuevo6)
                    .addComponent(lblPlacaNuevo4)
                    .addComponent(txtPrecioVenta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout panelImage2Layout = new javax.swing.GroupLayout(panelImage2);
        panelImage2.setLayout(panelImage2Layout);
        panelImage2Layout.setHorizontalGroup(
            panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage2Layout.createSequentialGroup()
                .addComponent(PanelNuevoVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelImage2Layout.setVerticalGroup(
            panelImage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage2Layout.createSequentialGroup()
                .addComponent(PanelNuevoVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        GrupoPaneles.addTab(resourceMap.getString("panelImage2.TabConstraints.tabTitle"), panelImage2); // NOI18N

        jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jScrollPane2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jScrollPane2.setName("jScrollPane2"); // NOI18N

        tblModificaciones.setName("tblModificaciones"); // NOI18N

        org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${lisObservableModificaciones}");
        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, tblModificaciones);
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${precio}"));
        columnBinding.setColumnName("Precio");
        columnBinding.setColumnClass(Double.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombre}"));
        columnBinding.setColumnName("Nombre");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jScrollPane2.setViewportView(tblModificaciones);
        tblModificaciones.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("tblModificaciones.columnModel.title0")); // NOI18N
        tblModificaciones.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tblModificaciones.columnModel.title1")); // NOI18N

        jPanel1.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 60, 310, 320));

        lblExtras.setFont(resourceMap.getFont("lblExtras.font")); // NOI18N
        lblExtras.setForeground(resourceMap.getColor("lblExtras.foreground")); // NOI18N
        lblExtras.setText(resourceMap.getString("lblExtras.text")); // NOI18N
        lblExtras.setName("lblExtras"); // NOI18N
        jPanel1.add(lblExtras, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 20, -1, 30));

        lblExtra1.setFont(resourceMap.getFont("lblExtra1.font")); // NOI18N
        lblExtra1.setForeground(resourceMap.getColor("lblExtra1.foreground")); // NOI18N
        lblExtra1.setText(resourceMap.getString("lblExtra1.text")); // NOI18N
        lblExtra1.setName("lblExtra1"); // NOI18N
        jPanel1.add(lblExtra1, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 60, -1, 30));

        GrupoPaneles.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        panelImage3.setName("panelImage3"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTable1.setName("jTable1"); // NOI18N

        eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listObservableVehiculo}");
        jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, jTable1);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${placa}"));
        columnBinding.setColumnName("Placa");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${anioFabricante}"));
        columnBinding.setColumnName("Anio Fabricante");
        columnBinding.setColumnClass(Integer.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${marca}"));
        columnBinding.setColumnName("Marca");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${modelo}"));
        columnBinding.setColumnName("Modelo");
        columnBinding.setColumnClass(String.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jScrollPane1.setViewportView(jTable1);
        jTable1.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("jTable1.columnModel.title0")); // NOI18N
        jTable1.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("jTable1.columnModel.title1")); // NOI18N
        jTable1.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("jTable1.columnModel.title2")); // NOI18N
        jTable1.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("jTable1.columnModel.title3")); // NOI18N

        lblVehiculo.setFont(resourceMap.getFont("lblVehiculo.font")); // NOI18N
        lblVehiculo.setForeground(resourceMap.getColor("lblVehiculo.foreground")); // NOI18N
        lblVehiculo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblVehiculo.setText(resourceMap.getString("lblVehiculo.text")); // NOI18N
        lblVehiculo.setName("lblVehiculo"); // NOI18N

        javax.swing.GroupLayout panelImage3Layout = new javax.swing.GroupLayout(panelImage3);
        panelImage3.setLayout(panelImage3Layout);
        panelImage3Layout.setHorizontalGroup(
            panelImage3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage3Layout.createSequentialGroup()
                .addGroup(panelImage3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelImage3Layout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 575, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelImage3Layout.createSequentialGroup()
                        .addGap(156, 156, 156)
                        .addComponent(lblVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 338, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(49, Short.MAX_VALUE))
        );
        panelImage3Layout.setVerticalGroup(
            panelImage3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 311, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(21, Short.MAX_VALUE))
        );

        GrupoPaneles.addTab(resourceMap.getString("panelImage3.TabConstraints.tabTitle"), panelImage3); // NOI18N

        panelImage4.setName("panelImage4"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jTable2.setName("jTable2"); // NOI18N

        jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, vehiculoList1, jTable2, "");
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${placa}"));
        columnBinding.setColumnName("Placa");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${marca}"));
        columnBinding.setColumnName("Marca");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${modelo}"));
        columnBinding.setColumnName("Modelo");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${clase}"));
        columnBinding.setColumnName("Clase");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${color}"));
        columnBinding.setColumnName("Color");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${aniofabricante}"));
        columnBinding.setColumnName("Aniofabricante");
        columnBinding.setColumnClass(Integer.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fecha}"));
        columnBinding.setColumnName("Fecha");
        columnBinding.setColumnClass(String.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jScrollPane3.setViewportView(jTable2);

        javax.swing.GroupLayout panelImage4Layout = new javax.swing.GroupLayout(panelImage4);
        panelImage4.setLayout(panelImage4Layout);
        panelImage4Layout.setHorizontalGroup(
            panelImage4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage4Layout.createSequentialGroup()
                .addGap(44, 44, 44)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 576, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(48, Short.MAX_VALUE))
        );
        panelImage4Layout.setVerticalGroup(
            panelImage4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage4Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(18, Short.MAX_VALUE))
        );

        GrupoPaneles.addTab(resourceMap.getString("panelImage4.TabConstraints.tabTitle"), panelImage4); // NOI18N

        javax.swing.GroupLayout panelRect1Layout = new javax.swing.GroupLayout(panelRect1);
        panelRect1.setLayout(panelRect1Layout);
        panelRect1Layout.setHorizontalGroup(
            panelRect1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRect1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(GrupoPaneles, javax.swing.GroupLayout.DEFAULT_SIZE, 668, Short.MAX_VALUE)
                .addContainerGap())
        );
        panelRect1Layout.setVerticalGroup(
            panelRect1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelRect1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(GrupoPaneles, javax.swing.GroupLayout.PREFERRED_SIZE, 462, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(35, 35, 35))
        );

        btnFinalizar2.setText(resourceMap.getString("btnFinalizar2.text")); // NOI18N
        btnFinalizar2.setMaximumSize(new java.awt.Dimension(71, 20));
        btnFinalizar2.setMinimumSize(new java.awt.Dimension(71, 20));
        btnFinalizar2.setName("btnFinalizar2"); // NOI18N
        btnFinalizar2.setPreferredSize(new java.awt.Dimension(71, 20));
        btnFinalizar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFinalizar2ActionPerformed(evt);
            }
        });

        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel3.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel3.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel5.setFont(new java.awt.Font("Courier 10 Pitch", 1, 24));
        jLabel5.setForeground(resourceMap.getColor("jLabel5.foreground")); // NOI18N
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        javax.swing.GroupLayout panelImage1Layout = new javax.swing.GroupLayout(panelImage1);
        panelImage1.setLayout(panelImage1Layout);
        panelImage1Layout.setHorizontalGroup(
            panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addGroup(panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(panelRound1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(panelImage1Layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addGap(39, 39, 39)
                                .addComponent(jLabel5))
                            .addComponent(jLabel3))
                        .addContainerGap(24, Short.MAX_VALUE))
                    .addGroup(panelImage1Layout.createSequentialGroup()
                        .addGroup(panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnFinalizar2, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(panelRect1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap())))
        );
        panelImage1Layout.setVerticalGroup(
            panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImage1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelRound1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addGap(8, 8, 8)
                .addComponent(panelRect1, javax.swing.GroupLayout.DEFAULT_SIZE, 503, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnFinalizar2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelImage1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelImage1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cbBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbBuscarActionPerformed
}//GEN-LAST:event_cbBuscarActionPerformed

    private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed
        listVehiculo.clear();
        lisModificacion.clear();
        //PLACA
        if (cbBuscar.getSelectedIndex() == 0) {
            dv = new DaoVehiculo();
            if (txtPlacaNuevo.getText().isEmpty() == false) {
                if (dv.buscarId(txtPlacaNuevo.getText().toUpperCase()) != null) {
                    bloquear(false);
                    GrupoPaneles.setSelectedIndex(0);
                    v1 = dv.buscarId(txtPlacaNuevo.getText().toUpperCase());
                    reemplazarCampos(v1);
                    abilitarCambos(false);
                    btnBuscar.setEnabled(false);
                    cbBuscar.setEditable(false);
                    repaint();
                } else {
                    JOptionPane.showMessageDialog(this, "Vehiculo NO Encontrado...");
                }
            } else {
                JOptionPane.showMessageDialog(this, "Placa Incorrecta...", "Error de Datos", JOptionPane.ERROR_MESSAGE);
                txtPlacaNuevo.setText("");
            }
        } else {
            //MARCA
            if (cbBuscar.getSelectedIndex() == 1) {
                bloquear(false);
                lblVehiculo.setText("MARCA DE BUSQUEDA: " + txtPlacaNuevo.getText());
                dv = new DaoVehiculo();
                if (txtPlacaNuevo.getText().isEmpty() == false) {
                    for (Vehiculo vehiculo : dv.buscarMarca(txtPlacaNuevo.getText())) {
                        System.out.println(vehiculo.getPlaca());
                    }
                    listObservableVehiculo.addAll(dv.buscarMarca(txtPlacaNuevo.getText()));
                    GrupoPaneles.setSelectedIndex(2);
                } else {
                    JOptionPane.showMessageDialog(this, "Marca Incorrecta...", "Error de Datos", JOptionPane.ERROR_MESSAGE);
                    txtPlacaNuevo.setText("");
                }
            } else {
                //AÑO
                if (cbBuscar.getSelectedIndex() == 2) {
                    if (txtPlacaNuevo.getText().isEmpty() == false) {
                        try {
                            dv = new DaoVehiculo();
                            listObservableVehiculo.addAll(dv.buscarAnio(txtPlacaNuevo.getText()));
                            bloquear(false);
                            GrupoPaneles.setSelectedIndex(2);
                            lblVehiculo.setText("AÑO DE BUSQUEDA: " + txtPlacaNuevo.getText());
                            for (Vehiculo v : dv.buscarAnio(txtPlacaNuevo.getText())) {
                                System.out.println(v.getPlaca());
                            }
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "ERROR EN EL INGRESO, INGRESE SOLAMENTE NÚMEROS");
                        }
                    } else {
                        JOptionPane.showMessageDialog(this, "Año Incorrecto...", "Error de Datos", JOptionPane.ERROR_MESSAGE);
                        txtPlacaNuevo.setText("");
                    }
                }
                if (cbBuscar.getSelectedIndex() == 3) {
                    bloquear(false);
                    GrupoPaneles.setSelectedIndex(3);
                }
            }
        }


    }//GEN-LAST:event_btnBuscarActionPerformed

    private void btnFinalizar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFinalizar2ActionPerformed
        dateFecha.setYear(new Date().getYear() + 1900);
        lblFotoVehiculo.setIcon(new ImageIcon(getClass().getResource("/org/eddycar/jproyeddycar/negocio/Imagenes/eddycarf2.JPG")));
        GrupoPaneles.setSelectedIndex(0);
        cbBuscar.setSelectedIndex(0);
        bloquear(true);
        txtPlacaNuevo.setText("");
}//GEN-LAST:event_btnFinalizar2ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.edisoncor.gui.tabbedPane.TabbedPaneVertical GrupoPaneles;
    private javax.swing.JPanel PanelNuevoVehiculo;
    private javax.swing.JButton btnBuscar;
    private javax.swing.JButton btnFinalizar2;
    private javax.swing.JComboBox cbBuscar;
    private javax.swing.JComboBox cbxCiudad;
    private com.toedter.calendar.JYearChooser dateFecha;
    private javax.persistence.EntityManager entityManager1;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JLabel lblChasis;
    private javax.swing.JLabel lblChasis1;
    private javax.swing.JLabel lblExtra1;
    private javax.swing.JLabel lblExtras;
    private org.edisoncor.gui.panel.PanelImage lblFotoVehiculo;
    private javax.swing.JLabel lblModelo;
    private javax.swing.JLabel lblMotor;
    private javax.swing.JLabel lblMotor1;
    private javax.swing.JLabel lblMotor2;
    private javax.swing.JLabel lblPlacaNuevo1;
    private javax.swing.JLabel lblPlacaNuevo2;
    private javax.swing.JLabel lblPlacaNuevo4;
    private javax.swing.JLabel lblPlacaNuevo5;
    private javax.swing.JLabel lblPlacaNuevo6;
    private javax.swing.JLabel lblTelfCel;
    private javax.swing.JLabel lblTelfCel1;
    private javax.swing.JLabel lblTelfCel2;
    private javax.swing.JLabel lblVehiculo;
    private java.util.List<org.eddycar.jproyeddycar.contrato.modelo.Vehiculo> list2;
    private org.edisoncor.gui.panel.PanelImage panelImage1;
    private org.edisoncor.gui.panel.PanelImage panelImage2;
    private org.edisoncor.gui.panel.PanelImage panelImage3;
    private org.edisoncor.gui.panel.PanelImage panelImage4;
    private org.edisoncor.gui.panel.PanelRect panelRect1;
    private org.edisoncor.gui.panel.PanelRound panelRound1;
    private javax.persistence.Query query1;
    private javax.swing.JTable tblModificaciones;
    private javax.swing.JTextField txtAnombre;
    private javax.swing.JTextField txtChasis;
    private javax.swing.JTextField txtCilindraje;
    private javax.swing.JTextField txtClase;
    private javax.swing.JTextField txtColor;
    private javax.swing.JTextField txtMarca;
    private javax.swing.JTextField txtMatricula1;
    private javax.swing.JTextField txtModelo;
    private javax.swing.JTextField txtMotor;
    private javax.swing.JTextField txtPlacaNuevo;
    private javax.swing.JTextField txtPrecio;
    private javax.swing.JTextField txtPrecioVenta;
    private javax.swing.JTextField txtTipo;
    private java.util.List<org.eddycar.jproyeddycar.contrato.modelo.Vehiculo> vehiculoList;
    private java.util.List<org.eddycar.jproyeddycar.contrato.modelo.Vehiculo> vehiculoList1;
    private javax.persistence.Query vehiculoQuery;
    private javax.persistence.Query vehiculoQuery1;
    private com.toedter.calendar.JYearChooser yearAñoFabricacion;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
    private List<Vehiculo> listVehiculo = new ArrayList<Vehiculo>();

    public List<Vehiculo> getListVehiculo() {
        return listVehiculo;
    }

    public void setListVehiculo(List<Vehiculo> listVehiculo) {
        this.listVehiculo = listVehiculo;
    }
    private ObservableList<Vehiculo> listObservableVehiculo = org.jdesktop.observablecollections.ObservableCollections.observableList(listVehiculo);

    public ObservableList<Vehiculo> getListObservableVehiculo() {
        return listObservableVehiculo;
    }

    public void setListObservableVehiculo(ObservableList<Vehiculo> listObservableVehiculo) {
        this.listObservableVehiculo = listObservableVehiculo;
    }
    private List<Modificacion> lisModificacion = new ArrayList<Modificacion>();

    public List<Modificacion> getLisModificacion() {
        return lisModificacion;
    }

    public void setLisModificacion(List<Modificacion> lisModificacion) {
        this.lisModificacion = lisModificacion;
    }
    private ObservableList<Modificacion> lisObservableModificaciones = org.jdesktop.observablecollections.ObservableCollections.observableList(lisModificacion);

    public ObservableList<Modificacion> getLisObservableModificaciones() {
        return lisObservableModificaciones;
    }

    public void setLisObservableModificaciones(ObservableList<Modificacion> lisObservableModificaciones) {
        this.lisObservableModificaciones = lisObservableModificaciones;
    }

    public void reemplazarCampos(Vehiculo v1) {
        txtChasis.setText(v1.getNumChasis());
        txtColor.setText(v1.getColor());
        txtMarca.setText(v1.getMarca());
        txtModelo.setText(v1.getModelo());
        txtMotor.setText(v1.getNumMotor());
        txtPlacaNuevo.setText(v1.getPlaca());
        txtTipo.setText(v1.getTipo());
        txtClase.setText(v1.getClase());
        txtPrecio.setText(String.valueOf(v1.getPrecioCompra()));
        yearAñoFabricacion.setYear(v1.getAnioFabricante());
        cbxCiudad.setSelectedItem(v1.getMatriculadoEn());
        dateFecha.setYear(Integer.parseInt(v1.getFecha()));
        lblFotoVehiculo.setIcon(new javax.swing.ImageIcon(v1.getFoto()));
        txtCilindraje.setText(v1.getCilindraje() + "");
        txtAnombre.setText(v1.getNombreMatricula());
        txtPrecioVenta.setText("" + (v1.getPrecioCompra() + v1.getPrecioExtra()));
    }

    public void abilitarCambos(boolean opc) {
        txtChasis.setEnabled(opc);
        txtColor.setEnabled(opc);
        txtMarca.setEnabled(opc);
        txtModelo.setEnabled(opc);
        txtMotor.setEnabled(opc);
        txtTipo.setEnabled(opc);
        txtPrecio.setEnabled(opc);
        yearAñoFabricacion.setEnabled(opc);
        cbxCiudad.setEnabled(opc);
        dateFecha.setEnabled(opc);
        txtClase.setEnabled(opc);
        txtCilindraje.setEnabled(opc);
        txtAnombre.setEnabled(opc);
        txtPrecioVenta.setEnabled(opc);
    }

    public void limpiar() {
        txtChasis.setText("");
        txtColor.setText("");
        txtMarca.setText("");
        txtModelo.setText("");
        txtMotor.setText("");
        txtTipo.setText("");
        txtPrecio.setText("");
        txtClase.setText("");
        txtCilindraje.setText("");
        txtAnombre.setText("");
        txtPrecioVenta.setText("");
    }

    public void bloquear(boolean s) {
        cbBuscar.setEnabled(s);
        txtPlacaNuevo.setEnabled(s);
        btnBuscar.setEnabled(s);
    }
}
